#!/bin/bash

# 测试套路径/home/xwx1135370/workspace/Testing
WORK_DIR=${PWD}

# 清空历史记录
# if [ -d ${WORK_DIR}/LLVM ] ;then
    # rm -rf ${WORK_DIR}/LLVM
# fi

# mkdir -p ${WORK_DIR}/LLVM

# 下载llvm代码
cd ${WORK_DIR}/LLVM
repo init -u https://gitee.com/OpenHarmony/manifest.git -b master -m llvm-toolchain.xml
repo sync -c 
repo forall -c 'git lfs pull'

cp -rf toolchain/llvm-project/llvm-build/ toolchain/

./toolchain/llvm-build/env_prepare.sh

# 全量编译
python3 ./toolchain/llvm-build/build.py

export LD_LIBRARY_PATH="${WORK_DIR}/LLVM/out/llvm_make/lib"

# 测试
${WORK_DIR}/LLVM/out/llvm_make/bin/llvm-lit -sva /home/chenhao/workspace/Hsu/LLVM/toolchain/llvm-project/lldb/test/API/
